package com.queming.core.controller;

import com.queming.core.mapper.SiteSettingMapper;
import com.queming.service.SiteSetting.SiteSettingService;
import com.queming.core.vo.SiteSettingVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chencidiao
 * @date 2022/05/04 21:53
 **/
@RestController
@RequestMapping("/setting")
public class SettingController {

    private SiteSettingService settingService;
    @Autowired
    public void setSettingService(SiteSettingService settingService) {
        this.settingService = settingService;
    }

    private SiteSettingMapper settingMapper;
    @Autowired
    public void setSettingMapper(SiteSettingMapper settingMapper) {
        this.settingMapper = settingMapper;
    }

    @GetMapping("/site")
    public SiteSettingVo getSitSetting(){
        return settingMapper.toVo(settingService.getSiteSetting());
    }
}
